All Questions
Tagged with javaenvironment-variables
29 questions
1vote
2answers
3kviews
"No X11 DISPLAY variable was set [...]" when using java.swing
When I'm trying to run a Java GUI application from the command line, I get: Exception in thread "main" java.awt.HeadlessException: "No X11 DISPLAY variable was set, or no headful ...
1vote
1answer
2kviews
Refer another Java version in a systemd service file
I have an application which requires JAVA_HOME environment to be set for a successfull running. On the RHEL server, however the current version of java points to "openjdk version "1.8.0_302&...
0votes
2answers
3kviews
Unable to build using Java OpenJDK 14. /bin/sh: javac: command not found
I've been tasked to work on updating a Java program that hasn't been touched for years and I'm running into issues building it using the latest version of Java OpenJDK 14.0.1.7-2 on Centos 7. When I ...
0votes
1answer
1kviews
How to start Jetty using start.jar from the console?
Having installed Jetty through apt how do I start the web server to get to a welcome page? Trying: java -jar /usr/share/jetty9/start.jar results in: ERROR : Nothing to start, exiting ... Usage: java ...
2votes
1answer
1kviews
Why are environment variables not resolved when double-clicking .desktop file?
I have a Java application which is launched by a shell script. The first part of the shell script is to resolve the Java location by looking at $JAVA_HOME. The shell script is working well if launched ...
0votes
1answer
812views
Are there downsides to setting path locations to symlinks?
I'm setting JAVA_HOME and using the alternatives location of /usr/lib/jvm/jre Which is a simlink to the absolute path of the current active installation. Are there downsides to using this symlinked ...
1vote
1answer
918views
My Java environment variables seem to be a complete mess how do I make a clean start without reinstalling?
I am trying to get Janusgraph working on OpenSuse Leap 42.3 but I'm running into a multitude of problems. My understanding is that JanusGraph invokes other Java dependencies, including gremlin & ...
1vote
1answer
1kviews
Messed up environment variables in Centos 7
When I am running my maven build I am getting this error: Error: JAVA_HOME is not defined correctly. We cannot execute /usr/bin/bin/java I have edited .bashrc, .profile, /root/.profile and /root/....
1vote
1answer
1kviews
How to set global variable visible even for sudo commands?
I have installed Maven on Ubuntu 16.04 following instructions. I edited /etc/environmentand added path to maven/bin folder to $PATH variable. Under my normal user everything works just fine, but ...
2votes
1answer
131views
Path pathology: java no longer working
There is some problem with my path which disrupts my java services. The components seem to be in the proper location. $ which java /usr/bin/java $ which javac /usr/bin/javac But the version query no ...
2votes
1answer
81views
I have installed java and it is working, but when i try to retrieve Java home it shwing empty [duplicate]
I installed Java in my red hat machine and when I run java -version, it is showing my installed java version. However, when I run echo $JAVA_HOME, nothing is displayed.
0votes
0answers
1kviews
How to set Java version to all users
I set the JAVA_HOME parameters in the etc/environment/ and when I do echo $JAVA_HOME, I can see the latest version which I have set. But when I do java -version it shows a different version, which is ...
3votes
1answer
22kviews
Why do I see "Unable to locate tools.jar. Expected to find it in ...." when I run ant (on RHEL 6.6) even though the path is set [closed]
I created a script in /etc/profile.d and named it jdk_home.sh. The contents of jdk_home.sh are as follows : #!/bin/sh export JAVA_HOME=$(readlink -f /usr/bin/javac | sed "s:/bin/javac::") export ...
1vote
1answer
5kviews
How to set a path variable without root acess? [duplicate]
My college currently uses a very old (like 3 years old) openJDK 1.7 distribution. And being a student, obviously I don't have root privileges. I wanted to use a much later version downloaded a much ...
1vote
1answer
5kviews
How to set multiple versions of Java on linux
I have Java 1.6 installed on my Linux box and all users and programs used it. Now, I need to install a program which uses version 1.7. I want to install this version such that everyone else continues ...